<%@ page contentType="text/html; charset=UTF-8" pageEncoding="utf-8"%>
<%@ include file="/common/init.jsp"%>
<link href="<c:url value='/admin/css/custom.css'/>" rel="stylesheet" type="text/css" />
<link href="<c:url value='/admin/css/style.css'/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value='/resources/js/jquery-1.7.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/resources/My97DatePicker/WdatePicker.js'/>"></script>
<style type="text/css">
<!--
body {
	background: #ffffff;
	margin-top:10px;
	margin-left:5px;
	margin-right:5px;
}
-->
</style>
<script type="text/javascript">

</script>
<body>
<div class="EpmsMainTitle">
<p>股票记录</P>
</div>
<div class="EpmsInall">
<div class="EpmsSubTitle"><p><b>查询条件</b></p>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
<form action="userstocklist.action" method="post" >
	<tr>
    <td width="10%" class="EpmsTdWithColor">
    	<span class="portlet-section-header">会员ID</span></td>
	<td width="23%" class="EpmsTdNoColor">
	 	<input type="text" name="account" value="${account}"  id="projectName" class=inputInput/>
	</td> 
    
	<td width="10%" class="EpmsTdWithColor">
    	<span class="portlet-section-header">价格</span></td> 
	<td width="43%" class="EpmsTdNoColor" >
		<input type="text" name="price1" id="price1" value="${price1}" size="16"/>
		---<input type="text" name="price2" id="price2" value="${price2}" size="16"/>
	</td>
    </tr>
  <tr>
  	<td width="10%" class="EpmsTdWithColor">
    	<span class="portlet-section-header">买卖</span></td> 
	<td width="23%" class="EpmsTdNoColor" >
		<select name="accountType" class=inputInput style="WIDTH: 120px"  id="select">
	  		<option value="">所有</option>
	  		<option value="0" <c:if test="${'0' eq accountType}">selected</c:if>>购买</option>
        	<option value="1" <c:if test="${'1' eq accountType}">selected</c:if>>沽出</option>
	    </select>
	</td>
    <td width="10%" class="EpmsTdWithColor">
    <span class="portlet-section-header">时间</span></td>
    <td width="43%" class="EpmsTdNoColor">
    	<input name="startDate" type="text" id="startDate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
			size="16" value="${startDate}"/>---
		<input name="endDate" type="text" id="endDate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
		size="16" value="${endDate}"/>
    </td>
    </tr>
    <tr>
		<td class="EpmsTdNoColor" colspan="4" align="center">
			<div class="EpmsButtonDiv">&nbsp;
			  <input type="submit" name="button" id="querybtn" value="查询" class="inputSubmit" />
			  <input type="reset" name="button" id="button" value="清空" class="inputSubmit" />
			</div>
		</td>
	</tr>
</form>
</table>

<div class="EpmsSubTitle"><p><b>会员列表</b></p>
</div>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="EpmsTable">
  <tr>
	  <td class=EpmsTdTitle>会员ID</td>
	  <td class=EpmsTdTitle>数目</td>
	  <td class=EpmsTdTitle>价格</td>
	  <td class=EpmsTdTitle>总价</td>
	  <td class=EpmsTdTitle>购买/沽出</td>
	  <td class=EpmsTdTitle>状态</td>
	  <td class=EpmsTdTitle>交易时间</td>
  </tr>
	<c:forEach var="userstock" items="${page.result }" varStatus="status">
		<tr>
			<td class=EpmsTdNoColor >${userstock.userId}</td>
		    <td class=EpmsTdNoColor >${userstock.stockQuantity }</td>
		    <td class=EpmsTdNoColor >${userstock.price }</td>
			<td class=EpmsTdNoColor >${userstock.totalPrice }</td>
			<td class=EpmsTdNoColor >
				<c:if test="${'0' eq userstock.type}">沽出</c:if>
				<c:if test="${'1' eq userstock.type}">购买</c:if>
			</td>
			<td class=EpmsTdNoColor>
				<fmt:formatDate value="${userstock.createDate}" pattern="yyyy-M-dd HH:mm:ss"/>
			</td>
		</tr>
	</c:forEach>
	<tr>
		<td class="EpmsTdNoColor" colspan="10" align="right">
		第${page.pageNo}页&nbsp;&nbsp;
			<c:choose>
			<c:when test="${page.pageNo >1}">
				<a href="javascript:void(0);" style="text-decoration: none;">
					<span onclick="frontpage(${page.pageNo-1})">上一页</span>&nbsp;
				</a>
			</c:when>
			<c:otherwise>
				上一页 &nbsp;
			</c:otherwise>
			</c:choose>
			<c:choose>
				<c:when test="${page.totalPageCount > page.pageNo}">	
					<a href="javascript:void(0);" style="text-decoration: none;">
						<span onclick="nextpage(${page.pageNo+1})">下一页</span> &nbsp;
					</a>
				</c:when>
				<c:otherwise>
					下一页&nbsp;
				</c:otherwise>
			</c:choose>
			&nbsp;共${page.totalPageCount }页
		</td>
	</tr>
</table>
</div>
</body>
<script type="text/javascript">
function frontpage(pageNo){
	location = "${ctx}/admin/userstocklist.action?pageNo="+pageNo;
}

function nextpage(pageNo){
	location = "${ctx}/admin/userstocklist.action?pageNo="+pageNo;
}
</script>